// 库区管理——所有接口

import request from '@/utils/request'

// 分页查询库区详细信息
export const pageAreaDetail = (params) => {
  return request({
    url: '/area/pageDetail',
    method: 'GET',
    params
  })
}

// 新增库区
export const addArea = (data) => {
  return request({
    url: '/area',
    method: 'POST',
    data
  })
}

// 查询库区
export const queryArea = (id) => {
  return request({
    url: `/area/${id}`,
    method: 'GET'
  })
}

// 修改库区
export const changeArea = (data) => {
  return request({
    url: '/area',
    method: 'PUT',
    data
  })
}

// 删除库区
export const delArea = (id) => {
  return request({
    url: '/area',
    method: 'DELETE',
    params: {
      'ids[]': id
    }
  })
}

// 查询全部库区
export const queryAllArea = (params) => {
  return request({
    url: '/area/list',
    method: 'GET',
    params
  })
}
